package com.xckj.controller.run.intermethod;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.xckj.entity.InterfaceMethod;
import com.xckj.service.InterfaceMethodService;

/**
 * @description 接口方法名称
 * @author yanchf
 * @date 2024-01-06
 */
@RestController
@RequestMapping(value = "/interfaceMethod")
public class InterfaceMethodController {

    @Resource
    private InterfaceMethodService interfaceMethodService;

    /**
    * 新增
    * @author yanchf
    * @date 2024/01/06
    **/
    @RequestMapping("/insert")
    public Object insert(InterfaceMethod interfaceMethod){
        return interfaceMethodService.insert(interfaceMethod);
    }

    /**
    * 刪除
    * @author yanchf
    * @date 2024/01/06
    **/
    @RequestMapping("/delete")
    public Object delete(InterfaceMethod interfaceMethod){
        return interfaceMethodService.delete(interfaceMethod);
    }

    /**
    * 更新
    * @author yanchf
    * @date 2024/01/06
    **/
    @RequestMapping("/update")
    public Object update(InterfaceMethod interfaceMethod){
        return interfaceMethodService.update(interfaceMethod);
    }

    /**
    * 查询 根据主键 id 查询
    * @author yanchf
    * @date 2024/01/06
    **/
    @RequestMapping("/load")
    public Object load(int id){
        return interfaceMethodService.load(id);
    }

    /**
    * 查询 分页查询
    * @author yanchf
    * @date 2024/01/06
    **/
    @RequestMapping("/pageList")
    public Map<String, Object> pageList(@RequestParam(required = false, defaultValue = "0") int offset,
                                        @RequestParam(required = false, defaultValue = "10") int pagesize) {
        return interfaceMethodService.pageList(offset, pagesize);
    }

    /**
    * 查询所有接口
    * @author yanchf
    * @date 2024/01/06
    **/
    @RequestMapping("/allMethod")
    public Map<String, Object> allMethod(@RequestParam(required = false, defaultValue = "0") int offset,
                                        @RequestParam(required = false, defaultValue = "10") int pagesize) {
        return interfaceMethodService.allMethod(offset, pagesize);
    }
    
    /**
    * 查询所有接口
    * @author yanchf
    * @date 2024/01/06
    **/
    @RequestMapping("/allMethodSelect")
    public Map<String, Object> allMethodSelect(@RequestParam(required = false, defaultValue = "0") int offset,
                                        @RequestParam(required = false, defaultValue = "10") int pagesize) {
        return interfaceMethodService.allMethodSelect(offset, pagesize);
    }
    
}